<html>
<head><meta charset="utf-8"><title>musing on -Zbuild-std vendoring · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html">musing on -Zbuild-std vendoring</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="222769170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/222769170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#222769170">(Jan 14 2021 at 19:25)</a>:</h4>
<p>I'm looking over the issues we ran into from my first implementation (<a href="https://github.com/rust-lang/wg-cargo-std-aware/issues/23#issuecomment-748253097">https://github.com/rust-lang/wg-cargo-std-aware/issues/23#issuecomment-748253097</a>) and geez this is a nasty hairball</p>



<a name="222769313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/222769313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#222769313">(Jan 14 2021 at 19:26)</a>:</h4>
<p>it really feels like we need to give cargo a native understanding of "subtree vendors" or somesuch, otherwise you'll get weird whackamole</p>



<a name="222769415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/222769415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#222769415">(Jan 14 2021 at 19:26)</a>:</h4>
<p><span class="user-mention" data-user-id="116015">@Alex Crichton</span> does that feel like a plausible avenue, or do you think more hacks are merited?</p>



<a name="222770014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/222770014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#222770014">(Jan 14 2021 at 19:30)</a>:</h4>
<p>maybe? Sorry I don't really know of a great way to solve these problems</p>



<a name="222770037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/222770037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#222770037">(Jan 14 2021 at 19:30)</a>:</h4>
<p>given what we had already it does seem like something will need to be added to Cargo that isn't there today</p>



<a name="222770834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/222770834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#222770834">(Jan 14 2021 at 19:35)</a>:</h4>
<p>hmmm</p>



<a name="223054899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/223054899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Ericson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#223054899">(Jan 17 2021 at 17:56)</a>:</h4>
<p>I think I agree. And also sub solution lock files and missing-subsolution lock files if that wasn't done.</p>



<a name="223054902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/223054902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Ericson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#223054902">(Jan 17 2021 at 17:56)</a>:</h4>
<p>Hacks -&gt; bugs, every time</p>



<a name="223162115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/223162115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Ericson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#223162115">(Jan 18 2021 at 20:41)</a>:</h4>
<p><span class="user-mention" data-user-id="137587">@Gankra</span> so as far as I can tell, the Cargo code for <code>Z build-std</code> seems to be trying to have two independent workspaces and then glom together their unit graphs post resolution? I think that's the original sin here: if <code>Zbuild-std</code> is not going to act all weird we instead need to combine the lockfiles and have one workspace resolved and built normally.</p>



<a name="223163059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/223163059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Ericson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#223163059">(Jan 18 2021 at 20:55)</a>:</h4>
<p>Somewhat relatedly, I left a comment at <a href="https://github.com/rust-lang/wg-cargo-std-aware/issues/23#issuecomment-762466564">https://github.com/rust-lang/wg-cargo-std-aware/issues/23#issuecomment-762466564</a></p>



<a name="223163143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/223163143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#223163143">(Jan 18 2021 at 20:56)</a>:</h4>
<p>Combining the lockfiles would mean that every time libstd adds a dependency, the user Cargo.lock would need to change, right? Currently the lockfile is independent of the used rustc version.</p>



<a name="223163250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/223163250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Ericson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#223163250">(Jan 18 2021 at 20:57)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> I mean the lockfiles would be combined on the fly by Cargo. The combined workspace corresponds to the combined lockfile.</p>



<a name="223163376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/223163376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Ericson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#223163376">(Jan 18 2021 at 20:59)</a>:</h4>
<p>Back to <a href="https://github.com/rust-lang/wg-cargo-std-aware/issues/23#issuecomment-762466564">https://github.com/rust-lang/wg-cargo-std-aware/issues/23#issuecomment-762466564</a>, If we do separate the stdlib crates from their deps, and make a patching vs mirror distinction, the "big global change" <span class="user-mention" data-user-id="120518">@Eric Huss</span> was worried about might be no worse than what I just proposed?</p>



<a name="223163443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/223163443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#223163443">(Jan 18 2021 at 21:00)</a>:</h4>
<p>Ah, still don't get how that would be better than glueing the unit graph though. In either case you would need to add dependencies on all sysroot crates to all user crates. I think this would be easier on the unit graph than before resolution as doing it before resolution would require injecting the dependencies every time the dependency resolution algorithm requests a new crate.</p>



<a name="223163510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/223163510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Ericson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#223163510">(Jan 18 2021 at 21:01)</a>:</h4>
<p>The unit graph thing seems super hacky to me, this is a type of code path that nothing else exercises, so bugs bus bugs.</p>



<a name="223163572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/223163572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Ericson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#223163572">(Jan 18 2021 at 21:02)</a>:</h4>
<p>the workspace and lockfile merging, being earlier in the pipeline, is more "macro-y": it is simulating something which could be written by hand. That feels much safer to me.</p>



<a name="223163636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/223163636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Ericson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#223163636">(Jan 18 2021 at 21:03)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> Also, remember we should get explicit standard library deps. Say someone wants to write a feature that turns on a standard library crate feature? Negotiating all that is a nightmare on the unit level, but easier if we make those dependencies real depedencies.</p>



<a name="223163830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/223163830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Ericson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#223163830">(Jan 18 2021 at 21:06)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> anyways, if you are confirming that the "independent resolutions, combine units" is what's going on today and not my misreading, I think I'll open a WG issue about this.</p>



<a name="223163905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/223163905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#223163905">(Jan 18 2021 at 21:07)</a>:</h4>
<p>I don't know much about the cargo internals.</p>



<a name="223164194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/223164194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Ericson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#223164194">(Jan 18 2021 at 21:12)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> well, that' makes two of us :)</p>



<a name="223174832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/musing%20on%20-Zbuild-std%20vendoring/near/223174832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Ericson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/musing.20on.20-Zbuild-std.20vendoring.html#223174832">(Jan 19 2021 at 00:05)</a>:</h4>
<p>OK I opened <a href="https://github.com/rust-lang/wg-cargo-std-aware/issues/64">https://github.com/rust-lang/wg-cargo-std-aware/issues/64</a> for this</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>